pp108 : searchPath Property (Tree)

searchPath Property (Tree)


Property that denotes the name of the XML Node present in the data that will be assigned to the tree.

Syntax

XML

<script type="cordys/xml" id=treeSchemaID>
    <TreeSchema>
        <searchPath>sXPath</searchPath>
        ...
        ...
        <TreeItem>
            <searchPath>sName</searchPath>
            ...
            ...
            ...
        </TreeItem>
    </TreeSchema>
</script>


Parameters

Parameter

Description

sXPath

String that denotes the XML node path (XSL Path) present in the data that will be assigned to the tree. This will be at the Root property of the treeSchema.

sName

String that denotes the XML node name present in the data that will be assigned to the tree. This will be at the treeItem property of the treeSchema.


Remarks


The value for this property will be the name of the XML node, or the XSLT path of the XML data that will be assigned to the tree.

For example, if the data appears in format of "tuple/old", then searchPath property in Root would be "//tuple/old/". The user is allowed to define custom tree nodes also.

Inside treeItem, the searchPath provided cannot be a recursive one, so only node name should be given.

Example


The following example demonstrates the usage of the property.

<!-- XML data sample -->
<script type="cordys/xml" id="data">
    <data>
        <tuple>
            <old>
                <Employees>
                    <EmployeeID>999</EmployeeID>
                    <FirstName>Nancy</FirstName>
                    <LastName>Davilio</LastName>
                </Employees>
            </old>
        </tuple>
    </data>
</script>
<!-- Schema for tree -->
<script type="cordys/xml" id="schema">
    <TreeSchema>
        <searchPath>//data/tuple/old/</searchPath>
        <Root>
            <description>Employees</description>
        </Root>
        <TreeItem id="EmployeesID">
            <searchPath>Employees</searchPath>
            <description>FirstName</description>
        </TreeItem>
    </TreeSchema>
</script>
<!-- tree definition -->
<div cordysType="wcp.libaray.ui.Tree" id="sampleTree" treeSchema="schema" treeData="data">
</div>

See Also


tree